package work.comeback.omo.model.http;

import com.google.gson.annotations.SerializedName;
import lombok.Data;

@Data
public class ResponseData {
    @SerializedName("code")
    private int code;

    @SerializedName("msg")
    private String msg;

    @SerializedName("data")
    private Object data;

    public ResponseData() {
        this(1, "success", null);
    }

    public ResponseData(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ResponseData success(String msg, Object data) {
        return new ResponseData(1, msg, data);
    }

    public static ResponseData fault(String msg, Object data) {
        return new ResponseData(0, msg, data);
    }
}